package com.vhall.component.entity.account.vo;

import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author lsl
 * @since 2021/7/30
 */
@Data
public class AdminAddReqVO implements Serializable {

    @ParamName("admin_name")
    @NotBlank(message = "admin_name不能为空")
    @Length(min = 1, max = 8, message = "admin_name长度错误")
    private String adminName;

    @NotBlank(message = "password不能为空")
    @Size(min = 6, max = 20, message = "密码必须在6到20位之间")
    @Length(min = 6, max = 20, message = "password长度错误")
    private String password;

    @ParamName("role_id")
    @NotNull(message = "role_id不能为空")
    private Integer roleId;

    private String mobile;

    @NotBlank(message = "email不能为空")
    @Email(message = "邮箱格式错误")
    @Size(max = 30, message = "email参数最长不能超过30")
    @Length(min = 1, max = 30, message = "email长度错误")
    private String email;

    @NotBlank(message = "confirm_password不能为空")
    @ParamName("confirm_password")
    @Length(min = 6, max = 20, message = "confirm_password长度错误")
    private String confirmPassword;
}
